/**
 * Author: runlin.tang
 * Creation Time: 2016-06-29.
 * Description:.���充电宝连接方式接口
 */
define(['jquery','../../common/ajax/ajax','../v/chongLink'],
    function($,ajax,chongLink) {
        function example(ssid,pass,mac){
            ajax({
                url:interfaces.set_wifi_settings.url,
                dataType:interfaces.set_wifi_settings.dataType,
                type:interfaces.set_wifi_settings.type,
                data:JSON.stringify({
                    ssid:ssid,
                    password:pass,
                    mac:mac
                }),
                cache:{
                    use:false,
                    name:'',
                    time:10
                },
                isOk:function(data){
                    var datas = '';
                    if(useNetData){
                        datas = data;
                    }else{
                        datas = data.chonglinks;
                    }
                    if(datas.data.wifi_set_status == 0){
                        chongLink(datas);
                    }else{
                        $(".contect-state").remove();
                        var html = '<div class="contect-state"><i>联网状态</i><span class="link-error">连接失败</span></div>';
                        $(".ly-pppoe").before(html);
                    }


                }
            });
        }
        return example;
    });